Clean up the DMADOM physical upper limit handling to properly honour
authorkfraser@localhost.localdomain <kfraser@localhost.localdomain>
Tue, 28 Nov 2006 16:41:45 +0000 (16:41 +0000)
committerkfraser@localhost.localdomain <kfraser@localhost.localdomain>
Tue, 28 Nov 2006 16:41:45 +0000 (16:41 +0000)
settings in config.h.

Set the upper limit for DMADOM and swiotlb allocations to be 30 bits
(1G) instead of 31 bits, to allow the b44 NIC driver to work.

Signed-off-by: Stephen Tweedie <sct@redhat.com>
linux-2.6-xen-sparse/arch/i386/kernel/swiotlb.c
xen/common/memory.c
xen/include/asm-ia64/config.h
xen/include/asm-x86/config.h

index b10026107391bf8ae086563cc4d287159b85cd5d..be749217b1330ab271187de066a4bdba1b648de9 100644 (file)
@@ -47,8 +47,8 @@ EXPORT_SYMBOL(swiotlb);
  */
 #define IO_TLB_SHIFT 11
 
-/* Width of DMA addresses in the IO TLB. 31 bits is an aacraid limitation. */
-#define IO_TLB_DMA_BITS 31
+/* Width of DMA addresses in the IO TLB. 30 bits is a b44 limitation. */
+#define IO_TLB_DMA_BITS 30
 
 static int swiotlb_force;
 static char *iotlb_virt_start;
index 33ead8e25951434ec5b4434bef75a44b97c3df43..db7e9153f22c3f5e68eacf32d4127123e212aa41 100644 (file)
@@ -328,7 +328,7 @@ static long memory_exchange(XEN_GUEST_HANDLE(xen_memory_exchange_t) arg)
          (exch.out.address_bits <
           (get_order_from_pages(max_page) + PAGE_SHIFT)) )
     {
-        if ( exch.out.address_bits < 31 )
+        if ( exch.out.address_bits < MAX_DMADOM_BITS )
         {
             rc = -ENOMEM;
             goto fail_early;
@@ -541,7 +541,7 @@ long do_memory_op(unsigned long cmd, XEN_GUEST_HANDLE(void) arg)
              (reservation.address_bits <
               (get_order_from_pages(max_page) + PAGE_SHIFT)) )
         {
-            if ( reservation.address_bits < 31 )
+            if ( reservation.address_bits < MAX_DMADOM_BITS )
                 return start_extent;
             args.memflags = MEMF_dma;
         }
index 05910e4310e9d922219dad392960770ab298a351..5a07cd6d7a853d26392f96fb318e441e04f67712 100644 (file)
@@ -41,7 +41,9 @@
 #define CONFIG_IOSAPIC
 #define supervisor_mode_kernel (0)
 
-#define MAX_DMADOM_PFN (0x7FFFFFFFUL >> PAGE_SHIFT) /* 31 addressable bits */
+#define MAX_DMADOM_BITS 30
+#define MAX_DMADOM_MASK ((1UL << MAX_DMADOM_BITS) - 1)
+#define MAX_DMADOM_PFN  (MAX_DMADOM_MASK >> PAGE_SHIFT)
 
 /* If PERFC is used, include privop maps.  */
 #ifdef PERF_COUNTERS
index cca215f4b29616212b9475fb89f8e0adef52c8da..8dedc54a677fcb7a9e5f8201dec754a0e654e287 100644 (file)
@@ -82,7 +82,9 @@
 /* Debug stack is restricted to 8kB by guard pages. */
 #define DEBUG_STACK_SIZE 8192
 
-#define MAX_DMADOM_PFN 0x7FFFFUL /* 31 addressable bits */
+#define MAX_DMADOM_BITS 30
+#define MAX_DMADOM_MASK ((1UL << MAX_DMADOM_BITS) - 1)
+#define MAX_DMADOM_PFN  (MAX_DMADOM_MASK >> PAGE_SHIFT)
 
 #ifndef __ASSEMBLY__
 extern unsigned long _end; /* standard ELF symbol */